<template>
  <el-card>
    <div slot="header" class="card-header">
      <span>{{ this.$route.meta.title }}</span>
      <div class="header-select">
        <i class="el-icon-menu"></i>
        <span>选择项：</span>
        <el-select v-model="selectVal" @change="selectChange">
          <el-option
            v-for="(item, index) in selectOptions"
            :key="index"
            :label="item.title"
            :value="index"
          >
          </el-option>
        </el-select>
      </div>
    </div>
    <el-card shadow="never">
      <div slot="header" class="card-header">
        <span>
          {{ selectOptions[selectVal].options[selectValB] }}
        </span>
        <el-select v-model="selectValB" @change="selectChange" size="mini">
          <el-option
            v-for="(item, index) in selectOptions[selectVal].options"
            :key="index"
            :label="item"
            :value="index"
          >
          </el-option>
        </el-select>
      </div>
      <SearchB class="mgb"></SearchB>
      <TableA class="mgb" :tableData="tableDataA"></TableA>
      <TableB :tableData="tableDataB"></TableB>
    </el-card>
  </el-card>
</template>

<script>
import variable from './variable'
import TableA from './components/TableA'
import TableB from './components/TableB'
import SearchB from './components/SearchB'
export default {
  components: {
    TableA,
    TableB,
    SearchB
  },

  data() {
    return {
      selectVal: 0,
      selectValB: 0,
      selectOptions: variable,
      tableDataA: [
        {
          columnA: '13420203929',
          columnB: '李木',
          columnC: '是',
          columnD: '2015',
          columnE: '√'
        },
        {
          columnA: '13420203929',
          columnB: '王凯',
          columnC: '是',
          columnD: '2015',
          columnE: '√'
        },
        {
          columnA: '13420203929',
          columnB: '王鄂',
          columnC: '是',
          columnD: '2017',
          columnE: '√'
        },
        {
          columnA: '13420203929',
          columnB: '陈兴',
          columnC: '是',
          columnD: '2017',
          columnE: '√'
        },
        {
          columnA: '13420203929',
          columnB: '张恩',
          columnC: '是',
          columnD: '2015',
          columnE: '√'
        }
      ],
      tableDataB: [
        {
          columnA: '13420203929',
          columnB: '王琛',
          columnC: '是',
          columnD: '2015',
          columnE: '√'
        },
        {
          columnA: '13420203929',
          columnB: '陶宏',
          columnC: '是',
          columnD: '2015',
          columnE: '√'
        },
        {
          columnA: '13420203929',
          columnB: '李艳',
          columnC: '是',
          columnD: '2017',
          columnE: '√'
        },
        {
          columnA: '13420203929',
          columnB: '陈峰',
          columnC: '是',
          columnD: '2017',
          columnE: '√'
        },
        {
          columnA: '13420203929',
          columnB: '张文',
          columnC: '是',
          columnD: '2015',
          columnE: '√'
        }
      ]
    }
  },

  methods: {
    selectChange() {}
  }
}
</script>

<style lang="scss" scoped>
.mgb {
  margin-bottom: 20px;
}
</style>
